#ifndef TOOLTIPEVENTHANDLER_HPP
#define TOOLTIPEVENTHANDLER_HPP

#include <QObject>
#include <QEvent>
#include <QDebug>
#include <QHelpEvent>
#include <QWheelEvent>
#include <QPoint>
#include <QMap>
#include <QApplication>

/**
* @brief Class TooltipEventHandler will catch events from CodeView and act accordingly
* @details This handler was designed to only support the Tooltip event from CodeView \n
* Due to some problems with zooming, this event has also been added to the filter. \n
* So the followings events are caught: Tooltip, MouseWheel with STRG pressed
*
* @class ToolTipEventHandler tooltipeventhandler.hpp "tooltipeventhandler.hpp"
*/
class ToolTipEventHandler : public QObject
{
Q_OBJECT
public:
    /**
    * @brief ToolTipEventHandler Constructor
    *
    * @fn explicit ToolTipEventHandler(QObject *parent = 0)
    * @param parent
    */
    explicit ToolTipEventHandler(QObject *parent = 0);

protected:
    /**
    * @brief The eventFilter is called if any event has been thrown
    * @details eventFilter will act on the following events: \n
    * \b QEvent::ToolTip \b : Checks if a Tooltip for the selected text is available and shows it \n
    * \b QEvent::Wheel \b : Will catch MouseWheel (only if STRG has been pressed) and emit the zoomEvent.
    * @see tooltipRequested(QPoint *point)
    * @see zoomEvent(int delta)
    *
    * @fn bool eventFilter(QObject *obj, QEvent *event)
    * @param obj
    * @param event
    * @return bool
    */
    bool eventFilter(QObject *obj, QEvent *event);

signals:
    /**
    * @brief Signal emitted when a tooltip has been requested on the specified point
    *
    * @fn void tooltipRequested(QPoint *point)
    * @param point
    */
    void tooltipRequested(QPoint *point);

    /**
    * @brief Signal emitted when the user scrolls the mouse while holding STRG to signal the Widgets to zoom
    *
    * @fn void zoomEvent(int delta)
    * @param delta
    */
    void zoomEvent(int delta);

};

#endif // TOOLTIPEVENTHANDLER_HPP
